import request from '@/utils/request'

// 导入导出不对应 1. 方式不对应  2. 名字
export function fetchDepartmentList() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 获取部门负责人列表
export function fetchManagerList() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

// 新增

export function fetchAddDepart(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 删除

export function fetchDelDepart(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 获取详情

export function fetchDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

// 更新详情
// 如果method不传 相当于只有get请求 无法识别data 只能认识params
export function fetchUpdateDepart(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
